package cn.ljy.quicksnip.model;

import cn.ljy.common.model.BaseModel;
import cn.ljy.common.model.validate.AddWorkValidation;
import cn.ljy.common.model.validate.UpdateWorkValidation;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

@ApiModel(value = "时间段模块")
@Data
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false, of = {"id"})
public class QsTimePeriod extends BaseModel {

    @ApiModelProperty(value = "时间段ID", example = "1")
    @NotNull(groups = UpdateWorkValidation.class, message = "时间段ID不能为空")
    private Long id;

    @ApiModelProperty(value = "时间块类别ID", example = "1")
    @NotNull(groups = AddWorkValidation.class, message = "时间块类别ID不能为空")
    private QsTimeBlock qsTimeBlock;
    private Long qsTimeBlockID;

    @ApiModelProperty(value = "时间段名称", required = true, example = "8:00-8:30")
    @NotBlank(groups = AddWorkValidation.class, message = "时间段名称不能为空")
    @Size(min = 1, max = 50, message = "时间段名称长度必须在 {min} - {max} 之间")
    private String periodName;

    @ApiModelProperty(value = "开始时间", example = "08:00:00")
    @NotNull(groups = AddWorkValidation.class, message = "开始时间不能为空")
    private java.sql.Time startTime;

    @ApiModelProperty(value = "结束时间", example = "08:30:00")
    @NotNull(groups = AddWorkValidation.class, message = "结束时间不能为空")
    private java.sql.Time endTime;



    public QsTimePeriod(Long id) {
        this.id = id;
    }
}

